<?php
/*
# ------------------------------------------------------------------------
# JA Teline III - Version 1.3 - Licence Owner jSharing.COM
# ------------------------------------------------------------------------
# Copyright (C) Lifetime Joomla Just for Sharing, Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: Joomla Just for Sharing
# Websites:  http://jsharing.com -  http://jsharing.net
# This file may not be redistributed in whole or significant part.
# ------------------------------------------------------------------------
*/

//JS-Kit config
$domain         = $this->plgParams->get('provider-jskit-domain');


$sefPath = JA_MakeSefUrl( $this->_path );
$sefUrl = JA_MakeSefUrl( $this->_url );
if ($this->isComment == false) {
	if (!defined('JACOMMENT_COUNT')) :
		$headscript = "
			<script type='text/javascript'>
			//<![CDATA[
			window.addEvent('domready', function(){
				var aCountComments = $$('span.js-kit-comments-count');
				if(aCountComments.length > 0) {
					Asset.javascript('http://js-kit.com/for/".$domain."/comments-count.js', {charset: 'utf-8'});
				}
			});
			//]]> 
			</script>
		";
		$this->document->addCustomTag($headscript);
		define('JACOMMENT_COUNT',1);
	endif;
?>
	<div class="jacomment-count"><a href="<?php echo $this->_path; ?>"><?php echo JText::_("COMMENTS"); ?> (<span class="js-kit-comments-count" uniq="<?php echo $sefPath; ?>">0</span>)</a></div>
<?php } else { ?>
	<div class="js-kit-comments" permalink="<?php echo $sefUrl;?>" path="<?php echo $sefPath;?>"></div>
	<script src="http://js-kit.com/for/<?php echo $domain?>/comments.js"></script>
<?php } ?>